{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n  var controlled = _ref.controlled,\n    defaultProp = _ref.default,\n    name = _ref.name,\n    _ref$state = _ref.state,\n    state = _ref$state === void 0 ? 'value' : _ref$state;\n  // isControlled is ignored in the hook dependency lists as it should never change.\n  var _React$useRef = React.useRef(controlled !== undefined),\n    isControlled = _React$useRef.current;\n  var _React$useState = React.useState(defaultProp),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    valueState = _React$useState2[0],\n    setValue = _React$useState2[1];\n  var value = isControlled ? controlled : valueState;\n  if (process.env.NODE_ENV !== 'production') {\n    React.useEffect(function () {\n      if (isControlled !== (controlled !== undefined)) {\n        console.error([\"MUI: A component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(name, \" \") + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n      }\n    }, [state, name, controlled]);\n    var _React$useRef2 = React.useRef(defaultProp),\n      defaultValue = _React$useRef2.current;\n    React.useEffect(function () {\n      if (!isControlled && defaultValue !== defaultProp) {\n        console.error([\"MUI: A component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n      }\n    }, [JSON.stringify(defaultProp)]);\n  }\n  var setValueIfUncontrolled = React.useCallback(function (newValue) {\n    if (!isControlled) {\n      setValue(newValue);\n    }\n  }, []);\n  return [value, setValueIfUncontrolled];\n}","map":{"version":3,"names":["React","useControlled","controlled","defaultProp","default","name","state","useRef","undefined","isControlled","current","useState","valueState","setValue","value","process","env","NODE_ENV","useEffect","console","error","join","defaultValue","JSON","stringify","setValueIfUncontrolled","useCallback","newValue"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/utils/esm/useControlled.js"],"sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n  controlled,\n  default: defaultProp,\n  name,\n  state = 'value'\n}) {\n  // isControlled is ignored in the hook dependency lists as it should never change.\n  const {\n    current: isControlled\n  } = React.useRef(controlled !== undefined);\n  const [valueState, setValue] = React.useState(defaultProp);\n  const value = isControlled ? controlled : valueState;\n  if (process.env.NODE_ENV !== 'production') {\n    React.useEffect(() => {\n      if (isControlled !== (controlled !== undefined)) {\n        console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n      }\n    }, [state, name, controlled]);\n    const {\n      current: defaultValue\n    } = React.useRef(defaultProp);\n    React.useEffect(() => {\n      if (!isControlled && defaultValue !== defaultProp) {\n        console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n      }\n    }, [JSON.stringify(defaultProp)]);\n  }\n  const setValueIfUncontrolled = React.useCallback(newValue => {\n    if (!isControlled) {\n      setValue(newValue);\n    }\n  }, []);\n  return [value, setValueIfUncontrolled];\n}"],"mappings":";AAAA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,eAAe,SAASC,aAAa,OAKlC;EAAA,IAJDC,UAAU,QAAVA,UAAU;IACDC,WAAW,QAApBC,OAAO;IACPC,IA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